<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreatePhonicsStudentsTable extends Migration
{

    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('phonics_students', function (Blueprint $table) {
            $table->timestamp('updated_at')->useCurrent();
            $table->timestamp('created_at');

            $table->integer('student_id');
            $table->tinyInteger('share_privilege')->default(0);
            $table->integer('share_count')->default(0);
            $table->decimal('bonus')->default(0);
            $table->decimal('bonus_withdraw')->default(0);
            $table->decimal('bonus_left')->default(0);

            $table->primary('student_id');
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('phonics_students');
    }
}
